package config

import (
	"github.com/nacos-group/nacos-sdk-go/common/constant"
	"github.com/zhang-jianqiang/microplugin/nacos"
	"go-micro.dev/v4/registry"
)

type nacosRegistry struct {
}

func (n *nacosRegistry) Register() registry.Registry {
	return nacos.NewRegistry(
		nacos.WithAddress([]string{
			"127.0.0.1:8848",
		}),
		nacos.WithClientConfig(constant.ClientConfig{
			LogDir:   "d:/alidata/logs/",
			CacheDir: "d:/alidata/logs",
			LogLevel: "error",
		}),
	)
}

func NewNacosRegistry() IMyRegistry {
	return &nacosRegistry{}
}
